<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<title>曲线</title>
		<script type="text/javascript"
			src="<s:url value='../../js/common/jquery-1.7.2.min.js'/>"></script>
		<script type="text/javascript" src="../../js/common/highcharts.js"></script>
		<script type="text/javascript"
			src="../../js/common/highChartsTheme.js"></script>
		<link id="easyuiTheme" rel="stylesheet" type="text/css"
			href="<s:url value='../../jquery-easyui/themes/stategrid/easyui.css'/>">
		<link rel="stylesheet" type="text/css"
			href="<s:url value='../../jquery-easyui/themes/icon.css'/>">
		<script type="text/javascript"
			src="<s:url value='../../jquery-easyui/jquery.easyui.min.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../../jquery-easyui/locale/easyui-lang-zh_CN.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../../js/common/commonUtil.js'/>"></script>
		<script type="text/javascript"
			src="<s:url value='../../js/common/datagridCommon.js'/>"></script>
		<script type="text/javascript">
$(function () {
	
	var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
    var chart;
    chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line',
            type: 'spline',  
            marginRight: 130,
            marginBottom: 25
            /**,
            events: {  
                load: function() {  
                    // set up the updating of the chart each second  
                    var series0 = this.series[0];  
                    var series1 = this.series[1];  
                    var series2 = this.series[2];  
                    var series3 = this.series[3];  
                    setInterval(function() {  
                        var x = (new Date()).getTime(), // current time  
                            y = Math.random();  
                        series0.addPoint([x, y], true, true);  
                        y = Math.random();  
                        series1.addPoint([x, y], true, true);  
                        y = Math.random();  
                        series2.addPoint([x, y], true, true); 
                        y = Math.random();   
                        series3.addPoint([x, y], true, true);  
                    }, 1000);  
                }  
            }  **/
        },
        title: {
            text: '月平均温度',
            x: -20 //center
        },
        subtitle: {
            text: 'Source: WorldClimate.com',
            x: -20
        },
        credits: {
         href: "http://www.wasion.com",
         text: "wasion"
     },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        yAxis: {
            title: {
                text: 'Temperature (°C)'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            formatter: function() {
                    return '<b>'+ this.series.name +'</b><br/>'+
                    this.x +': '+ this.y +'°C';
            }
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'top',
            x: -10,
            y: 100,
            borderWidth: 0
        },
        series: [{
            name: 'Tokyo',
            data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
        }, {
            name: 'New York',
            data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
        }, {
            name: 'Berlin',
            data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]
        }, {
            name: 'London',
            data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
        }]
    });
    
});

$(function(){
			
			var datagridId = "bureauDatagrid"; // 数据集对应table的id
			var listUrl = "../../archives/showBureaus.action"; // 请求数据集的action
			var title = "供电局信息"; // 数据集的标题
			var columns = [[
					{field: 'bureauId', hidden: true},
					{field: 'bureauNo', title: '供电局编号', width: $(this).width() * 0.10},
					{field: 'bureauName', title: '供电局名称', width: $(this).width() * 0.35},
					{field: 'bureauAddr', title: '供电局地址', width: $(this).width() * 0.35},
					{field: 'bureauTelephone', title: '联系电话', width: $(this).width() * 0.20}
				]]; // 数据集的列信息，列标题，对应的内容和宽度
		    
		    /**
		     *编辑参数，新增和编辑共用同一个表单，在编辑操作和新增操作中这些参数是一样的
		     *modalWinId：彈出窗口id
		     *submitBtnId： 提交按鈕id
		     *formId：表單id
		     *msgFlag：請求action，返回消息對應的屬性
		     ***/
		    var editParams = {
    				modalWinId: "addOrEditWin", 
    				submitBtnId: "addOrEditBtn",
    				formId: "form",
    				msgFlag: "msg"
		    	};	
		    	
		    var addParams = {
    				addUrl: "../../archives!addOrModifyBureau.action"
				};// 新增操作参数，包括新增操作请求地址
		    var modifyParams = {
		    		loadUrl: "../../archives/loadBureauByPk.action",
		    		identityId: ["bureauId"],
		    		modifyUrl: "../../archives!addOrModifyBureau.action"
		    	};// 修改操作参数，包括修改操作请求地址
		    
		    // 删除操作参数，包括删除操作请求地址，行唯一主键，请求action，返回消息对应的json属性
		    var removeParams = {
		    		removeUrl: "../../archives!removeBureauById.action", 
    				identityId: "bureauId",
    				msgFlag: "msg"
    			};

			/**
			*查询操作参数
			*queryFormId：查询表单id
			*queryBtnId：查询按钮id
			*/
			var queryParams = {
				queryFormId: "queryForm",
				queryBtnId: "queryBtnFunc"
			}
			
			/**
			导出excel记录
			**/
			var exportParams = {
				exportUrl: "../../archives/exportBureaus.action"
			}
			
			//显示表单
			showDataGrid(datagridId, listUrl, title, columns, editParams, addParams, removeParams, queryParams, modifyParams, exportParams);
			
		});
</SCRIPT>
	</head>
	<body>
		<table id="bureauDatagrid" style="margin: 10px;">
		</table>
		<div id="container">
		</div>

	</body>
</html>
